#ifndef LogManagement_H
#define LogManagement_H

#include "touchbutton.h"
#include <QWidget>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QLabel>
#include <QPushButton>
#include <QListView>
#include <QStandardItemModel>
#include <QApplication>
#include <QMouseEvent>
#include <QTabWidget>
enum LogType{
    OPERATE=0,
    WARNING
};
class LogManagement : public QWidget
{
    Q_OBJECT
public:
    explicit LogManagement(QWidget *parent = nullptr);

private:
    void initUI();
    QWidget * createList( QListView *listView,LogType lType);
    void showEvent(QShowEvent *event);
private slots:
    void onSwitchPage(int nID, bool b);
    void onRowsInserted(const QModelIndex &parent, int first, int last);
    void onCleanClicked();
private:
    QTabWidget *tabWidget;
    QListView *operateListView;
    QListView *warningListView;
    QWidget *headerWidget;
    QButtonGroup* m_pButtonGroup=nullptr;
    TouchButton *m_pOperationLogBtn=nullptr;
    TouchButton * m_pAlarmLogBtn=nullptr;
    TouchButton * m_pCleanBtn=nullptr;

    // QWidget interface
public slots:
    void setVisible(bool visible);
};

#endif // LogManagement_H
